<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>2D变换_多重交换</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .outer{
            width: 300px;
            height: 300px;
            border:2px solid black;
            margin: 800px;

        }
        .inner{
            width: 300px;
            height: 300px;
            background-color: deepskyblue;
            text-align: center;
            line-height: 300px;
            margin: auto;
            /*先进行位移,再进行缩放*/
            transform: translate(100px,100px) scale(0.5);
        }
        .inner1{
            width: 300px;
            height: 300px;
            background-color: deepskyblue;
            text-align: center;
            line-height: 300px;
            margin: auto;
            /*先进行缩放,再进行位移,在缩放之后的位置为原点进行位移*/
            transform:  scale(0.5) translate(100px,100px);
        }
        .inner2{
            width: 300px;
            height: 300px;
            background-color: deepskyblue;
            text-align: center;
            line-height: 300px;
            margin: auto;
            /*先进行位移,再进行旋转,旋转的时候绕着位移之后图像的中心点进行旋转*/
            transform:translate(100px,100px) rotate(30deg);
        }
        .inner3{
            width: 300px;
            height: 300px;
            background-color: deepskyblue;
            text-align: center;
            line-height: 300px;
            margin: auto;
            /*先进行旋转,再进行位移
               旋转之后坐标轴会随着旋转而变化,之后的位移是随着轴进行的
            */
            transform:  rotate(30deg) translate(100px,100px);
        }
    </style>
</head>
<body>
<div class="outer">
    <div class="inner">inner</div>
</div>
<div class="outer">
    <div class="inner1">inner</div>
</div>
<div class="outer">
    <div class="inner2">inner</div>
</div>
<div class="outer">
    <div class="inner3">inner</div>
</div>

</body>
</html>